<?php

use yii\helpers\Inflector;
use yii\helpers\StringHelper;

/* @var $this yii\web\View */
/* @var $generator yii\gii\generators\crud\Generator */

/* @var $model \yii\db\ActiveRecord */
$model = new $generator->modelClass();
$safeAttributes = $model->safeAttributes();
if (empty($safeAttributes)) {
    $safeAttributes = $model->attributes();
}

echo "<?php\n";
?>

use yii\helpers\Html;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model <?= ltrim($generator->modelClass, '\\') ?> */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="<?= Inflector::camel2id(StringHelper::basename($generator->modelClass)) ?>-form">
<div class="x_panel">
    <?= "<?php " ?>$form = ActiveForm::begin(); ?>
	<?= "<?php " ?> echo Html::hiddenInput('urlReferrer',!empty($list['urlReferrer']) ? $list['urlReferrer'] : null);?>
    
    <div class="x_title">
        <h2><?= "<?= " ?> Html::encode($this->title) ?></h2>
        <div class="nav navbar-right ">
            <?= "<?= " ?> Html::submitButton('<i class="glyphicon glyphicon-floppy-disk"></i>', ['class' => 'btn btn-success']) ?>
            <?= "<?= " ?> Html::a('<i class="fa fa-mail-reply"></i>', !empty($list['urlReferrer']) ? $list['urlReferrer'] : ['index'], ['class'=>'btn btn-default'])?>
        </div>
        <div class="clearfix"></div>
    </div>
    <div class="x_content">
<?php foreach ($generator->getColumnNames() as $attribute) {
    if (in_array($attribute, $safeAttributes)) {
        echo "    <?= " . $generator->generateActiveField($attribute) . " ?>\n\n";
    }
} ?>
    </div>
    <?= "<?php " ?>ActiveForm::end(); ?>
</div>

</div>
